const path_ = eval('require')('path');
const fs = eval('require')('fs');
const {
    basePath,
    appAsar,
} = require('../../foreEndApi/rebasePath')();

if (fs.existsSync(path_.join(basePath, 'winSetting.json'))) {
    winSetting = eval('require')(path_.join(basePath, 'winSetting.json'));
} else {
    winSetting = eval('require')('./../../winSetting.json');
}

module.exports = (BrowserWindow) => {
    winSetting.devTool = (winSetting.devTool || []);
    winSetting.devTool = winSetting.devTool instanceof Array ? winSetting.devTool : [];
    winSetting.devTool.map((dt) => {
        let tool = '';
        if (dt instanceof Array) {
            tool = path_.join(basePath, ...dt);
        } else {
            tool = path_.join(basePath, dt);
        }
        BrowserWindow.addDevToolsExtension(tool);
    });
};

